<html>
<head><meta charset="utf-8"><title>copy trait · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html">copy trait</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="195615180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195615180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195615180">(Apr 28 2020 at 19:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281572">marmeladema</span> <a href="#narrow/stream/144729-wg-traits/topic/New.20contributor/near/195296414" title="#narrow/stream/144729-wg-traits/topic/New.20contributor/near/195296414">said</a>:</p>
<blockquote>
<p>For scalar its mentioned that <code>// Implementations provided in libcore</code>. But in chalk we should say all scalar are copy right? And tuples are copy if all elements are copy?</p>
</blockquote>
<p>Hmm, <span class="user-mention" data-user-id="281572">@marmeladema</span>, good point -- I forgot that we had those impls in libcore.</p>



<a name="195615224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195615224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195615224">(Apr 28 2020 at 19:39)</a>:</h4>
<p>Or at least I'd want to compare how rustc does it</p>



<a name="195615277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195615277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195615277">(Apr 28 2020 at 19:39)</a>:</h4>
<p>I guess I don't have a super strong opinion about this, but in general it's probably nicer to have fewer things "hard-coded" in, and more things controlled by libcore/libstd</p>



<a name="195615423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195615423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195615423">(Apr 28 2020 at 19:40)</a>:</h4>
<div class="codehilite"><pre><span></span><code>            ty::Uint(_)
            | ty::Int(_)
            | ty::Bool
            | ty::Float(_)
            | ty::Char
            | ty::RawPtr(..)
            | ty::Never
            | ty::Ref(_, _, hir::Mutability::Not) =&gt; {
                // Implementations provided in libcore
                None
            }
</code></pre></div>



<a name="195615471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195615471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195615471">(Apr 28 2020 at 19:40)</a>:</h4>
<p>yeah. probably we should match that behavior, actually.</p>



<a name="195615490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195615490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195615490">(Apr 28 2020 at 19:41)</a>:</h4>
<p>From <code>librustc_trait_selection/traits/select.rs</code></p>



<a name="195616682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195616682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195616682">(Apr 28 2020 at 19:50)</a>:</h4>
<p>Ok thanks. My PR originally included impl copy for all scalars but then i removed it, so it should be fine</p>



<a name="195619073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195619073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195619073">(Apr 28 2020 at 20:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I <em>think</em> i've fixed all the comments</p>



<a name="195623054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195623054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195623054">(Apr 28 2020 at 20:33)</a>:</h4>
<p>if <code>u8: impl Copy</code>, should <code>(u8, ): Clone</code>? In my mind, <code>u8: impl Copy</code> =&gt; <code>u8: impl Clone</code> thus <code>(u8, ): impl Clone</code></p>



<a name="195623242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195623242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195623242">(Apr 28 2020 at 20:34)</a>:</h4>
<p>I would expect so, yes</p>



<a name="195623250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195623250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195623250">(Apr 28 2020 at 20:34)</a>:</h4>
<p>But</p>



<a name="195623257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195623257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195623257">(Apr 28 2020 at 20:35)</a>:</h4>
<p>it is possible that chalk can't figure this out</p>



<a name="195623273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195623273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195623273">(Apr 28 2020 at 20:35)</a>:</h4>
<p>unless you have both a <code>impl Copy for u8</code> and a <code>impl Clone for u8</code></p>



<a name="195623303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195623303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195623303">(Apr 28 2020 at 20:35)</a>:</h4>
<p>since the scalar impls are not 'built-in' but are coming from the user</p>



<a name="195623322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195623322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195623322">(Apr 28 2020 at 20:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/copy.20trait/near/195623257" title="#narrow/stream/144729-wg-traits/topic/copy.20trait/near/195623257">said</a>:</p>
<blockquote>
<p>it is possible that chalk can't figure this out</p>
</blockquote>
<p>in fact, this is the behavior I expect, so if you see something else, I'd like to know</p>



<a name="195623341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195623341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195623341">(Apr 28 2020 at 20:35)</a>:</h4>
<p>the reason has to do with implied bounds</p>



<a name="195623513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195623513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195623513">(Apr 28 2020 at 20:36)</a>:</h4>
<p>Yes, chalk cannot figure it out. I was worried it was a bug, but it seems to be fine :)</p>



<a name="195624888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195624888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195624888">(Apr 28 2020 at 20:49)</a>:</h4>
<p>ps we're discussing exactly this right now ;)</p>



<a name="195625153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195625153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195625153">(Apr 28 2020 at 20:51)</a>:</h4>
<p>i am reading :D (but not understanding everything^^)</p>



<a name="195626377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195626377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195626377">(Apr 28 2020 at 21:01)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> the PR failed because of the flakky error discussed during the meeting</p>



<a name="195626403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195626403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195626403">(Apr 28 2020 at 21:01)</a>:</h4>
<p>should i push-force to trigger another build?</p>



<a name="195626438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195626438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195626438">(Apr 28 2020 at 21:01)</a>:</h4>
<p>sure, or I could tell travis to re-run</p>



<a name="195626498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195626498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195626498">(Apr 28 2020 at 21:02)</a>:</h4>
<p>oh I can?</p>



<a name="195626556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195626556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195626556">(Apr 28 2020 at 21:02)</a>:</h4>
<p>I don't think i have the permissions</p>



<a name="195626800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195626800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195626800">(Apr 28 2020 at 21:04)</a>:</h4>
<p>I can</p>



<a name="195626859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195626859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195626859">(Apr 28 2020 at 21:04)</a>:</h4>
<p>Oh sorry misread</p>



<a name="195626930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195626930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195626930">(Apr 28 2020 at 21:05)</a>:</h4>
<p>ok, looks good tho</p>



<a name="195626942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195626942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195626942">(Apr 28 2020 at 21:05)</a>:</h4>
<p>travis is re-running</p>



<a name="195627468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/copy%20trait/near/195627468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/copy.20trait.html#195627468">(Apr 28 2020 at 21:10)</a>:</h4>
<p>all checks passed <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>